
/**
 * jQuery 抖动插件
 * @param	intShakes 	Amount of shakes
 * @param	intDistance Shake distance
 * @param	intDuration Time duration
 *
 * example:
	$(function() {
		$('#btn').click(function() {
			$(this).Shake(2,10,400);
		});
	});
 */
 
jQuery.fn.Shake = function(intShakes /*Amount of shakes*/, intDistance /*Shake distance*/, intDuration /*Time duration*/) {
	this.each(function() {
		var jqNode = $(this);
		jqNode.css({position: 'relative'});
		for (var x=1; x<=intShakes; x++) {
			jqNode.animate({ left: (intDistance * -1) },(((intDuration / intShakes) / 4)))
			.animate({ left: intDistance },((intDuration/intShakes)/2))
			.animate({ left: 0 },(((intDuration/intShakes)/4)));
		}
	});
	return this;
}